const chatRoomingApi = {
    /**
     * 窗口列表
     *
     * @returns {Promise<ChatRoomingListResponse[]>}
     * @author zero
     */
    lists(): Promise<ChatRoomingListResponse[]> {
        return $request.get<ChatRoomingListResponse[]>({
            url: '/agent/chat/rooming/lists'
        })
    },

    /**
     * 窗口初始
     *
     * @param {string} bot 智能体编号
     * @returns {Promise<ChatRoomingInitResponse>}
     * @author zero
     */
    init(bot: string): Promise<ChatRoomingInitResponse> {
        return $request.get<ChatRoomingInitResponse>({
            url: '/agent/chat/rooming/init',
            params: {
                bot
            }
        }, {
            isDisableErrorPopup: true
        })
    },

    /**
     * 窗口创建
     *
     * @param {string} bot 智能体编号
     * @returns {Promise<void>}
     * @author zero
     */
    create(bot: string): Promise<void> {
        return $request.post({
            url: '/agent/chat/rooming/create',
            params: {
                bot
            }
        })
    },

    /**
     * 窗口删除
     *
     * @param {string} bot 智能体编号
     * @returns {Promise<any>}
     * @author zero
     */
    delete(bot: string): Promise<any> {
        return $request.post({
            url: '/agent/chat/rooming/delete',
            params: {
                bot
            }
        })
    }
}

export default chatRoomingApi
